home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / QuickTimeVRFormat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  13.4 KB  |  474 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QuickTimeVRFormat.h
  3.  
  4.      Contains:    QuickTime VR interfaces
  5.  
  6.      Version:    Technology:    QuickTime VR 2.0.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __QUICKTIMEVRFORMAT__
  19. #define __QUICKTIMEVRFORMAT__
  20.  
  21. #ifndef __CONDITIONALMACROS__
  22. #include <ConditionalMacros.h>
  23. #endif
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27. #ifndef __MOVIES__
  28. #include <Movies.h>
  29. #endif
  30. #ifndef __QUICKTIMEVR__
  31. #include <QuickTimeVR.h>
  32. #endif
  33.  
  34.  
  35.  
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT
  45. #pragma import on
  46. #endif
  47.  
  48. #if PRAGMA_STRUCT_ALIGN
  49.     #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51.     #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53.     #pragma pack(2)
  54. #endif
  55.  
  56.  
  57. /* File Format Version numbers */
  58. #define kQTVRMajorVersion (2)
  59. #define kQTVRMinorVersion (0)
  60.  
  61. /* User data type for the Movie Controller type specifier*/
  62.  
  63. enum {
  64.     kQTControllerType            = kQTVRControllerSubType,        /* Atom & ID of where our*/
  65.     kQTControllerID                = 1                                /* … controller name is stored*/
  66. };
  67.  
  68. /* VRWorld atom types*/
  69.  
  70. enum {
  71.     kQTVRWorldHeaderAtomType    = FOUR_CHAR_CODE('vrsc'),
  72.     kQTVRImagingParentAtomType    = FOUR_CHAR_CODE('imgp'),
  73.     kQTVRPanoImagingAtomType    = FOUR_CHAR_CODE('impn'),
  74.     kQTVRObjectImagingAtomType    = FOUR_CHAR_CODE('imob'),
  75.     kQTVRNodeParentAtomType        = FOUR_CHAR_CODE('vrnp'),
  76.     kQTVRNodeIDAtomType            = FOUR_CHAR_CODE('vrni'),
  77.     kQTVRNodeLocationAtomType    = FOUR_CHAR_CODE('nloc')
  78. };
  79.  
  80. /* NodeInfo atom types*/
  81.  
  82. enum {
  83.     kQTVRNodeHeaderAtomType        = FOUR_CHAR_CODE('ndhd'),
  84.     kQTVRHotSpotParentAtomType    = FOUR_CHAR_CODE('hspa'),
  85.     kQTVRHotSpotAtomType        = FOUR_CHAR_CODE('hots'),
  86.     kQTVRHotSpotInfoAtomType    = FOUR_CHAR_CODE('hsin'),
  87.     kQTVRLinkInfoAtomType        = FOUR_CHAR_CODE('link')
  88. };
  89.  
  90. /* Miscellaneous atom types*/
  91.  
  92. enum {
  93.     kQTVRStringAtomType            = FOUR_CHAR_CODE('vrsg'),
  94.     kQTVRPanoSampleDataAtomType    = FOUR_CHAR_CODE('pdat'),
  95.     kQTVRObjectInfoAtomType        = FOUR_CHAR_CODE('obji'),
  96.     kQTVRAngleRangeAtomType        = FOUR_CHAR_CODE('arng'),
  97.     kQTVRTrackRefArrayAtomType    = FOUR_CHAR_CODE('tref'),
  98.     kQTVRPanConstraintAtomType    = FOUR_CHAR_CODE('pcon'),
  99.     kQTVRTiltConstraintAtomType    = FOUR_CHAR_CODE('tcon'),
  100.     kQTVRFOVConstraintAtomType    = FOUR_CHAR_CODE('fcon')
  101. };
  102.  
  103. /* Track reference types*/
  104.  
  105. enum {
  106.     kQTVRImageTrackRefType        = FOUR_CHAR_CODE('imgt'),
  107.     kQTVRHotSpotTrackRefType    = FOUR_CHAR_CODE('hott')
  108. };
  109.  
  110. /* Old hot spot types*/
  111.  
  112. enum {
  113.     kQTVRHotSpotNavigableType    = FOUR_CHAR_CODE('navg')
  114. };
  115.  
  116. /* Valid bits used in QTVRLinkHotSpotAtom*/
  117.  
  118. enum {
  119.     kQTVRValidPan                = 1 << 0,
  120.     kQTVRValidTilt                = 1 << 1,
  121.     kQTVRValidFOV                = 1 << 2,
  122.     kQTVRValidViewCenter        = 1 << 3
  123. };
  124.  
  125.  
  126. /* Values for flags field in QTVRPanoSampleAtom*/
  127.  
  128. enum {
  129.     kQTVRPanoFlagHorizontal        = 1 << 0,
  130.     kQTVRPanoFlagLast            = 1 << 31
  131. };
  132.  
  133.  
  134. /* Values for locationFlags field in QTVRNodeLocationAtom*/
  135.  
  136. enum {
  137.     kQTVRSameFile                = 0
  138. };
  139.  
  140.  
  141. /* Header for QTVR track's Sample Description record (vrWorld atom container is appended)*/
  142. struct QTVRSampleDescription {
  143.     UInt32                             descSize;                    /* total size of the QTVRSampleDescription*/
  144.     UInt32                             descType;                    /* must be 'qtvr'*/
  145.  
  146.     UInt32                             reserved1;                    /* must be zero*/
  147.     UInt16                             reserved2;                    /* must be zero*/
  148.     UInt16                             dataRefIndex;                /* must be zero*/
  149.  
  150.     UInt32                             data;                        /* Will be extended to hold vrWorld QTAtomContainer*/
  151.  
  152. };
  153. typedef struct QTVRSampleDescription QTVRSampleDescription;
  154.  
  155. typedef QTVRSampleDescription *            QTVRSampleDescriptionPtr;
  156. typedef QTVRSampleDescriptionPtr *        QTVRSampleDescriptionHandle;
  157. /*
  158.   =================================================================================================
  159.    Definitions and structures used in the VRWorld QTAtomContainer
  160.   -------------------------------------------------------------------------------------------------
  161. */
  162.  
  163.  
  164. struct QTVRStringAtom {
  165.     UInt16                             stringUsage;
  166.     UInt16                             stringLength;
  167.     unsigned char                     theString[4];                /* field previously named "string"*/
  168. };
  169. typedef struct QTVRStringAtom QTVRStringAtom;
  170.  
  171. typedef QTVRStringAtom *                QTVRStringAtomPtr;
  172.  
  173.  
  174. struct QTVRWorldHeaderAtom {
  175.     UInt16                             majorVersion;
  176.     UInt16                             minorVersion;
  177.  
  178.     QTAtomID                         nameAtomID;
  179.     UInt32                             defaultNodeID;
  180.     UInt32                             vrWorldFlags;
  181.  
  182.     UInt32                             reserved1;
  183.     UInt32                             reserved2;
  184. };
  185. typedef struct QTVRWorldHeaderAtom QTVRWorldHeaderAtom;
  186.  
  187. typedef QTVRWorldHeaderAtom *            QTVRWorldHeaderAtomPtr;
  188.  
  189. /* Valid bits used in QTVRPanoImagingAtom*/
  190.  
  191. enum {
  192.     kQTVRValidCorrection        = 1 << 0,
  193.     kQTVRValidQuality            = 1 << 1,
  194.     kQTVRValidDirectDraw        = 1 << 2,
  195.     kQTVRValidFirstExtraProperty = 1 << 3
  196. };
  197.  
  198. struct QTVRPanoImagingAtom {
  199.     UInt16                             majorVersion;
  200.     UInt16                             minorVersion;
  201.  
  202.     UInt32                             imagingMode;
  203.     UInt32                             imagingValidFlags;
  204.  
  205.     UInt32                             correction;
  206.     UInt32                             quality;
  207.     UInt32                             directDraw;
  208.     UInt32                             imagingProperties[6];        /* for future properties*/
  209.  
  210.     UInt32                             reserved1;
  211.     UInt32                             reserved2;
  212. };
  213. typedef struct QTVRPanoImagingAtom QTVRPanoImagingAtom;
  214.  
  215. typedef QTVRPanoImagingAtom *            QTVRPanoImagingAtomPtr;
  216. struct QTVRNodeLocationAtom {
  217.     UInt16                             majorVersion;
  218.     UInt16                             minorVersion;
  219.  
  220.     OSType                             nodeType;
  221.     UInt32                             locationFlags;
  222.     UInt32                             locationData;
  223.  
  224.     UInt32                             reserved1;
  225.     UInt32                             reserved2;
  226. };
  227. typedef struct QTVRNodeLocationAtom QTVRNodeLocationAtom;
  228.  
  229. typedef QTVRNodeLocationAtom *            QTVRNodeLocationAtomPtr;
  230. /*
  231.   =================================================================================================
  232.    Definitions and structures used in the Nodeinfo QTAtomContainer
  233.   -------------------------------------------------------------------------------------------------
  234. */
  235.  
  236. struct QTVRNodeHeaderAtom {
  237.     UInt16                             majorVersion;
  238.     UInt16                             minorVersion;
  239.  
  240.     OSType                             nodeType;
  241.     QTAtomID                         nodeID;
  242.     QTAtomID                         nameAtomID;
  243.     QTAtomID                         commentAtomID;
  244.  
  245.     UInt32                             reserved1;
  246.     UInt32                             reserved2;
  247. };
  248. typedef struct QTVRNodeHeaderAtom QTVRNodeHeaderAtom;
  249.  
  250. typedef QTVRNodeHeaderAtom *            QTVRNodeHeaderAtomPtr;
  251. struct QTVRAngleRangeAtom {
  252.     Float32                         minimumAngle;
  253.     Float32                         maximumAngle;
  254. };
  255. typedef struct QTVRAngleRangeAtom QTVRAngleRangeAtom;
  256.  
  257. typedef QTVRAngleRangeAtom *            QTVRAngleRangeAtomPtr;
  258. struct QTVRHotSpotInfoAtom {
  259.     UInt16                             majorVersion;
  260.     UInt16                             minorVersion;
  261.  
  262.     OSType                             hotSpotType;
  263.     QTAtomID                         nameAtomID;
  264.     QTAtomID                         commentAtomID;
  265.  
  266.     SInt32                             cursorID[3];
  267.  
  268.                                                                 /* canonical view for this hot spot*/
  269.     Float32                         bestPan;
  270.     Float32                         bestTilt;
  271.     Float32                         bestFOV;
  272.     QTVRFloatPoint                     bestViewCenter;
  273.  
  274.                                                                 /* Bounding box for this hot spot*/
  275.     Rect                             hotSpotRect;
  276.  
  277.     UInt32                             flags;
  278.     UInt32                             reserved1;
  279.     UInt32                             reserved2;
  280. };
  281. typedef struct QTVRHotSpotInfoAtom QTVRHotSpotInfoAtom;
  282.  
  283. typedef QTVRHotSpotInfoAtom *            QTVRHotSpotInfoAtomPtr;
  284. struct QTVRLinkHotSpotAtom {
  285.     UInt16                             majorVersion;
  286.     UInt16                             minorVersion;
  287.  
  288.     UInt32                             toNodeID;
  289.  
  290.     UInt32                             fromValidFlags;
  291.     Float32                         fromPan;
  292.     Float32                         fromTilt;
  293.     Float32                         fromFOV;
  294.     QTVRFloatPoint                     fromViewCenter;
  295.  
  296.     UInt32                             toValidFlags;
  297.     Float32                         toPan;
  298.     Float32                         toTilt;
  299.     Float32                         toFOV;
  300.     QTVRFloatPoint                     toViewCenter;
  301.  
  302.     Float32                         distance;
  303.  
  304.     UInt32                             flags;
  305.     UInt32                             reserved1;
  306.     UInt32                             reserved2;
  307. };
  308. typedef struct QTVRLinkHotSpotAtom QTVRLinkHotSpotAtom;
  309.  
  310. typedef QTVRLinkHotSpotAtom *            QTVRLinkHotSpotAtomPtr;
  311. /*
  312.   =================================================================================================
  313.    Definitions and structures used in Panorama and Object tracks
  314.   -------------------------------------------------------------------------------------------------
  315. */
  316.  
  317. struct QTVRPanoSampleAtom {
  318.     UInt16                             majorVersion;
  319.     UInt16                             minorVersion;
  320.  
  321.     UInt32                             imageRefTrackIndex;            /* track reference index of the full res image track*/
  322.     UInt32                             hotSpotRefTrackIndex;        /* track reference index of the full res hot spot track*/
  323.  
  324.     Float32                         minPan;
  325.     Float32                         maxPan;
  326.     Float32                         minTilt;
  327.     Float32                         maxTilt;
  328.     Float32                         minFieldOfView;
  329.     Float32                         maxFieldOfView;
  330.  
  331.     Float32                         defaultPan;
  332.     Float32                         defaultTilt;
  333.     Float32                         defaultFieldOfView;
  334.  
  335.                                                                 /* Info for highest res version of image track*/
  336.     UInt32                             imageSizeX;                    /* pixel width of the panorama (e.g. 768)*/
  337.     UInt32                             imageSizeY;                    /* pixel height of the panorama (e.g. 2496)*/
  338.     UInt16                             imageNumFramesX;            /* diced frames wide (e.g. 1)*/
  339.     UInt16                             imageNumFramesY;            /* diced frames high (e.g. 24)*/
  340.  
  341.                                                                 /* Info for highest res version of hotSpot track*/
  342.     UInt32                             hotSpotSizeX;                /* pixel width of the hot spot panorama (e.g. 768)*/
  343.     UInt32                             hotSpotSizeY;                /* pixel height of the hot spot panorama (e.g. 2496)*/
  344.     UInt16                             hotSpotNumFramesX;            /* diced frames wide (e.g. 1)*/
  345.     UInt16                             hotSpotNumFramesY;            /* diced frames high (e.g. 24)*/
  346.  
  347.     UInt32                             flags;
  348.     UInt32                             reserved1;
  349.     UInt32                             reserved2;
  350.  
  351. };
  352. typedef struct QTVRPanoSampleAtom QTVRPanoSampleAtom;
  353.  
  354. typedef QTVRPanoSampleAtom *            QTVRPanoSampleAtomPtr;
  355. /* Special resolution value for the FastStart low resolution image track*/
  356.  
  357. enum {
  358.     kQTVRFastStartTrackRes        = 0x8000
  359. };
  360.  
  361. struct QTVRTrackRefEntry {
  362.     UInt32                             trackRefType;
  363.     UInt16                             trackResolution;
  364.     UInt32                             trackRefIndex;
  365. };
  366. typedef struct QTVRTrackRefEntry QTVRTrackRefEntry;
  367.  
  368. /*
  369.   =================================================================================================
  370.    Object File format 2.0
  371.   -------------------------------------------------------------------------------------------------
  372. */
  373.  
  374. enum {
  375.     kQTVRObjectAnimateViewFramesOn = (1 << 0),
  376.     kQTVRObjectPalindromeViewFramesOn = (1 << 1),
  377.     kQTVRObjectStartFirstViewFrameOn = (1 << 2),
  378.     kQTVRObjectAnimateViewsOn    = (1 << 3),
  379.     kQTVRObjectPalindromeViewsOn = (1 << 4),
  380.     kQTVRObjectSyncViewToFrameRate = (1 << 5),
  381.     kQTVRObjectDontLoopViewFramesOn = (1 << 6)
  382. };
  383.  
  384.  
  385. enum {
  386.     kQTVRObjectWrapPanOn        = (1 << 0),
  387.     kQTVRObjectWrapTiltOn        = (1 << 1),
  388.     kQTVRObjectCanZoomOn        = (1 << 2),
  389.     kQTVRObjectReverseHControlOn = (1 << 3),
  390.     kQTVRObjectReverseVControlOn = (1 << 4),
  391.     kQTVRObjectSwapHVControlOn    = (1 << 5),
  392.     kQTVRObjectTranslationOn    = (1 << 6)
  393. };
  394.  
  395.  
  396. enum {
  397.     kGrabberScrollerUI            = 1,                            /* "Object" */
  398.     kOldJoyStickUI                = 2,                            /*  "1.0 Object as Scene"     */
  399.     kJoystickUI                    = 3,                            /* "Object In Scene"*/
  400.     kGrabberUI                    = 4,                            /* "Grabber only"*/
  401.     kAbsoluteUI                    = 5                                /* "Absolute pointer"*/
  402. };
  403.  
  404.  
  405. struct QTVRObjectSampleAtom {
  406.     UInt16                             majorVersion;                /* kQTVRMajorVersion*/
  407.     UInt16                             minorVersion;                /* kQTVRMinorVersion*/
  408.     UInt16                             movieType;                    /* ObjectUITypes*/
  409.     UInt16                             viewStateCount;                /* The number of view states 1 based*/
  410.     UInt16                             defaultViewState;            /* The default view state number. The number must be 1 to viewStateCount*/
  411.     UInt16                             mouseDownViewState;            /* The mouse down view state.   The number must be 1 to viewStateCount*/
  412.     UInt32                             viewDuration;                /* The duration of each view including all animation frames in a view*/
  413.     UInt32                             columns;                    /* Number of columns in movie*/
  414.     UInt32                             rows;                        /* Number rows in movie*/
  415.     Float32                         mouseMotionScale;            /* 180.0 for kStandardObject or kQTVRObjectInScene, actual degrees for kOldNavigableMovieScene.*/
  416.     Float32                         minPan;                        /* Start   horizontal pan angle in degrees*/
  417.     Float32                         maxPan;                        /* End     horizontal pan angle in degrees*/
  418.     Float32                         defaultPan;                    /* Initial horizontal pan angle in degrees (poster view)*/
  419.     Float32                         minTilt;                    /* Start   vertical   pan angle in degrees*/
  420.     Float32                         maxTilt;                    /* End     vertical   pan angle in degrees*/
  421.     Float32                         defaultTilt;                /* Initial vertical   pan angle in degrees (poster view)    */
  422.     Float32                         minFieldOfView;                /* minimum field of view setting (appears as the maximum zoom effect) must be >= 1*/
  423.     Float32                         fieldOfView;                /* the field of view range must be >= 1*/
  424.     Float32                         defaultFieldOfView;            /* must be in minFieldOfView and maxFieldOfView range inclusive*/
  425.     Float32                         defaultViewCenterH;
  426.     Float32                         defaultViewCenterV;
  427.  
  428.     Float32                         viewRate;
  429.     Float32                         frameRate;
  430.     UInt32                             animationSettings;            /* 32 reserved bit fields*/
  431.     UInt32                             controlSettings;            /* 32 reserved bit fields*/
  432.  
  433. };
  434. typedef struct QTVRObjectSampleAtom QTVRObjectSampleAtom;
  435.  
  436. typedef QTVRObjectSampleAtom *            QTVRObjectSampleAtomPtr;
  437. #if OLDROUTINENAMES
  438. typedef QTVRStringAtom                     VRStringAtom;
  439. typedef QTVRWorldHeaderAtom             VRWorldHeaderAtom;
  440. typedef QTVRPanoImagingAtom             VRPanoImagingAtom;
  441. typedef QTVRNodeLocationAtom             VRNodeLocationAtom;
  442. typedef QTVRNodeHeaderAtom                 VRNodeHeaderAtom;
  443. typedef QTVRAngleRangeAtom                 VRAngleRangeAtom;
  444. typedef QTVRHotSpotInfoAtom             VRHotSpotInfoAtom;
  445. typedef QTVRLinkHotSpotAtom             VRLinkHotSpotAtom;
  446. typedef QTVRPanoSampleAtom                 VRPanoSampleAtom;
  447. typedef QTVRTrackRefEntry                 VRTrackRefEntry;
  448. typedef QTVRObjectSampleAtom             VRObjectSampleAtom;
  449. #endif  /* OLDROUTINENAMES */
  450.  
  451.  
  452.  
  453.  
  454. #if PRAGMA_STRUCT_ALIGN
  455.     #pragma options align=reset
  456. #elif PRAGMA_STRUCT_PACKPUSH
  457.     #pragma pack(pop)
  458. #elif PRAGMA_STRUCT_PACK
  459.     #pragma pack()
  460. #endif
  461.  
  462. #ifdef PRAGMA_IMPORT_OFF
  463. #pragma import off
  464. #elif PRAGMA_IMPORT
  465. #pragma import reset
  466. #endif
  467.  
  468. #ifdef __cplusplus
  469. }
  470. #endif
  471.  
  472. #endif /* __QUICKTIMEVRFORMAT__ */
  473.  
  474.